<template>
    <div class="account-info-wrapper">
        <div style="border:1px solid #e9eaec">
        <Card>
            <p slot="title" class="sub-title">
                <span class="account-type">结算信息</span>
            </p>

            <kv-wrap
                v-if="datas"
                label-width="120"
                align="left"
                padding="20px">

                <kv-item label="商户类型:">
                    {{datas.client_type | clientType}}
                </kv-item>
                <kv-item label="是否冻结:">
                    {{datas.is_freeze | booleanStatus}}
                </kv-item>
                <kv-item label="是否允许延保维修账单月结:">
                    {{datas.is_ticket_billing | booleanStatus}}
                </kv-item>
                <kv-item label="新装结算方式:">
                    {{datas.payment_type | paymentType}}
                </kv-item>
                <kv-item label="售后结算方式:">
                    {{datas.settle_type | settleType}}
                </kv-item>
                <kv-item label="账单过期天数:">
                    {{datas.bill_over_days || '未设置'}}
                </kv-item>

            </kv-wrap>
        </Card>
        </div>
    </div>
</template>

<script>
export default {
  name: 'settlement-info',
  props: {
    datas: Object
  },
  filters: {
    clientType (input) {
      switch (input) {
        case 1:
          return '账期'
        case 2:
          return '项目制'
        case 3:
          return '数量'
        case 4:
          return '金额'
        default:
          return '未设置'
      }
    },
    settleType (input) {
      switch (input) {
        case 1:
          return '月结'
        case 2:
          return '现场支付'
        default:
          return '未设置'
      }
    },
    paymentType (input) {
      switch (input) {
        case 1:
          return '月结'
        case 2:
          return '项目制'
        case 3:
          return '先款后货'
        default:
          return '未设置'
      }
    },
    booleanStatus (input) {
      if (input === undefined) return '未设置'
      return input ? '是' : '否'
    }
  }
}
</script>